﻿using ParkSaleForAdmin.Data;
using ParkSaleForAdmin.Foundation;

namespace ParkSaleForAdmin.FunctionWindow
{
    public class UserInfo
    {
        [DataToUI("身份证", false)]
        public string id
        {
            get;
            set;
        }
        [DataToUI("用户名")]
        public string username
        {
            get;
            set;
        }
        [DataToUI("密码")]
        public string password
        {
            get;
            set;
        }
        [DataToUI("联系电话")]
        public string phone
        {
            get;
            set;
        }

    }

    class User : BasicManagerWindow<UserInfo>
    {
        public override string TableName => "User";

        public User()
        {
            add.IsEnabled = false;
            delete.IsEnabled = false;
            inputbox.Visibility = System.Windows.Visibility.Collapsed;
        }
        public override string DeleteStr(UserInfo obj)
        {
            return SQLHelpler.MakeSelectStr(TableName, "id", obj.id);
        }

        public override string AppendStr(UserInfo obj)
        {
            return SQLHelpler.MakeSelectStr(TableName, "id", "999999");
        }

        public override string ChangeStr(UserInfo obj)
        {
            return SQLHelpler.MakeSelectStr(TableName, "id", obj.id);
        }
    }
}
